﻿using ERP.Workflow.Designer.Domain.Shared;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Data;
using Volo.Abp.Domain.Entities;
using Volo.Abp.MultiTenancy;

namespace ERP.Workflow.Designer.Domain
{
    public class Port : AggregateRoot<Guid>, IMultiTenant, ISoftDelete
    {
        public Guid ParentId { get; set; }
        public Node Parent { get; set; }
        public double X { get; set; }
        public double Y { get; set; }
        public double Width { get; set; }
        public double Height { get; set; }

        //  public List<Link>? Links { get; set; } = new List<Link>(4);
        public Guid DefinitionId { get; set; }
        public Definition Definition { get; set; }

        public Guid? TenantId { get; set; }

        public bool IsDeleted { get; set; }

        public PortAlignments PortAlignments { get; set; }

       
        public void SetId(Guid id)
        {
            base.Id = id;
        }
        public void Set(Guid parentId ,double x, double y, double width, double height, PortAlignments portAlignment)
        {
            
            this.X = x;
            this.Y = y;
            this.Width = width;
            this.Height = height;
            this.PortAlignments = portAlignment;
            this.ParentId=parentId;
        }
        public void SetTenantId(Guid? tenantId)
        {
            TenantId = tenantId;
        }
        public void SorftDelet() => IsDeleted = true;

    }

}

